package com.groupbuying.redpacket.dao;

import com.groupbuying.redpacket.domain.RedPacketRuleDO;
import com.groupbuying.redpacket.domain.RedPacketTaskDO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 红包规则
 * @author vincnetxin
 * @email vincentxin@aliyun.com
 * @date 2019-11-12 14:54:44
 * @des
 */

@Mapper
@Repository
public interface RedPacketRuleDao {

	RedPacketRuleDO get(Long id);
	
	List<RedPacketRuleDO> list(Map<String, Object> map);
	
	int count(Map<String, Object> map);
	
	int save(RedPacketRuleDO redPacketRule);
	
	int update(RedPacketRuleDO redPacketRule);
	
	int remove(Long id);
	
	int batchRemove(Long[] ids);
    /**
     * 根据TaskId查询rule
     */
    List<RedPacketRuleDO> ruleByTaskId(String taskId);


    /**
     *根据taskId物理删除Rule
     */
    int deleteByTaskId(String taskId);
    /**
     * 批量添加
     */
    int insertBatch(List<RedPacketRuleDO> list);
}
